package com.gs.remoting;

import java.util.Collection;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class Client {
	public static void main(String[] args) {
		ApplicationContext context = new ClassPathXmlApplicationContext("spring-client-config.xml");
		AccountService accountService = context.getBean(AccountService.class);
		Collection<Account> accounts = accountService.getAccounts(null);
		System.out.println("Account size : " + accounts.size());
		accountService.insertAccount(new Account());
		accounts = accountService.getAccounts(null);
		System.out.println("Account size : " + accounts.size());
		accountService.insertAccount(new Account());
		accounts = accountService.getAccounts(null);
		System.out.println("Account size : " + accounts.size());
		accountService.insertAccount(new Account());
		accounts = accountService.getAccounts(null);
		System.out.println("Account size : " + accounts.size());
		accountService.insertAccount(new Account());
		accounts = accountService.getAccounts(null);
		System.out.println("Account size : " + accounts.size());
		accountService.insertAccount(new Account());
		accounts = accountService.getAccounts(null);
		System.out.println("Account size : " + accounts.size());
		accountService.insertAccount(new Account());
		accounts = accountService.getAccounts(null);
		System.out.println("Account size : " + accounts.size());		
	}
}
